from zope.interface import Interface, Attribute

class IPerson(Interface):
    """a person"""
    
    profiles = Attribute("""list of profiles implementing IProfile""")
    contacts = Attribute("""list of contacts of this person, pointing to other persons""")
    
    def addProfile(profile):
        """add a profile to a person
        
        profiles will be stored with their URLs as keys
        
        """
        
    def delProfile(url):
        """delete a profile identified by key <url>"""
        
    def getProfiles(url):
        """return list of profiles"""
        
    def extend():
        """extend the profiles by walking all profiles and trying to find new ones linked
        by either rel=me or FOAF
        
        This discovery mechanism should probably be pluggable.
        
        """
    
class IProfile(Interface):
    """a profile attached to a person
    
    a profile can be any webpage this person claims to own. It might be referenced by e.g. rel="me"
    
    """
    
    url = Attribute("""URL of the profile page""")
    

